package cn.lena.weblog.service.impl;

import cn.lena.weblog.dao.CatagoryDao;
import cn.lena.weblog.domain.Catagory;
import cn.lena.weblog.service.CatagoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CatagoryServiceImpl implements CatagoryService{

	@Autowired
	private CatagoryDao catagoryDao;

	@Override
	public List<Catagory> findAll() {
		return catagoryDao.findAll();
	}

	@Override
	public List<Catagory> findByUserId(Integer userId) {
		return catagoryDao.findByUserId(userId);
	}

	@Override
	public int addCatagory(Catagory catagory) {
		return catagoryDao.addCatagory(catagory);
	}

	@Override
	public List<Catagory> findCollectByUserId(Integer userId) {
		return catagoryDao.findCollectByUserId(userId);
	}

	@Override
	public int delCatagory(Catagory catagory) {
		return catagoryDao.deleteCatagory(catagory);
	}

}
